import request from '@/utils/request'

/**
 * 获取维修单
 * @param {*} query 
 * @returns 
 */
export function recordListApi(query) {
    return request({
        url: '/plumber/dormProperty',
        method: 'get',
        params: query
    })
}
/**
 * 获取楼宇列表
 * @param {*} query 
 * @returns 
 */
export function getBuildingApi() {
    return request({
        url: '/plumber/waterElectricity/getBuilds',
        method: 'get'
    })
}
/**
 * 获取宿舍列表
 * @param {*} query 
 * @returns 
 */
export function getDormApi(val) {
    return request({
        url: '/plumber/waterElectricity/getDorms',
        method: 'get',
        params: {
            "buildId": val
        }
    })
}
/**
 * 添加水电费
 * @param {*} form 
 * @returns 
 */
export function addWaterElectricityApi(form) {
    return request({
        url: '/plumber/waterElectricity',
        method: 'post',
        data: form
    })
}

/**
 * 获取水电费信息
 * @param {*} query 
 * @returns 
 */
export function getWaterElectricityInfoApi(query) {
    return request({
        url: '/plumber/waterElectricity',
        method: 'get',
        params: query
    })
}
/**
 * 更改水电费信息
 * @param {*} form 
 * @returns 
 */
export function updateWaterElectricityInfoApi(form) {
    return request({
        url: '/plumber/waterElectricity',
        method: 'put',
        data: form
    })
}
export function delWaterElectricityRecordApi(val) {
    return request({
        url: '/plumber/waterElectricity',
        method: 'delete',
        params: {
            "id": val
        }
    })
}

/**
 * 更改维修信息
 * @param {*} form 
 * @returns 
 */
export function updateRepairApi(form) {
    return request({
        url: '/plumber/dormProperty',
        method: 'put',
        data: form
    })
}
/**
 * 新增维修信息
 */
export function adddormPropertyMainTainApi(form) {
    return request({
        url: '/plumber/dormProperty',
        method: 'post',
        data: form
    })
}

